﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

/* Generated  */
namespace EDMXParserV1
{
        [Serializable]
    public class AssociationSetMapping
    {
        public AssociationSetMapping()
        {
            EndProperties = new List<EndProperty>();
        }

        public List<EndProperty> EndProperties { get; set; }

        public string Name { get; set; }
        public string TypeName { get; set; }
        public string StoreEntitySet { get; set; }

        public static AssociationSetMapping New(System.Xml.XmlNode Node)
        {
            AssociationSetMapping AssociationSetMapping = new AssociationSetMapping();

            foreach (XmlAttribute Attribute in Node.Attributes)
            {
                switch (Attribute.Name)
                {
                    case "Name":
                        AssociationSetMapping.Name = Attribute.Value;
                        break;
                    case "TypeName":
                        AssociationSetMapping.TypeName = Attribute.Value;
                        break;
                    case "StoreEntitySet":
                        AssociationSetMapping.StoreEntitySet = Attribute.Value;
                        break;
                    default:
                        Globals.AttributeSwitchCoder(Attribute);
                        break;
                }

            }

            foreach (XmlNode ChildNode in Node.ChildNodes)
            {
                switch (ChildNode.Name)
                {
                    case "EndProperty":
                        EndProperty EndProperty = EndProperty.New( ChildNode);
                        AssociationSetMapping.EndProperties.Add(EndProperty);
                        break;
                    default:
                        Globals.NodeSwitchCoder(ChildNode);
                        break;
                }
            }

            return AssociationSetMapping;
        }
    }
}
